package com.mask.collections;

import java.util.Arrays;
import java.util.List;

/**
 * ClassName ListTest
 * Create by hx
 * Date 2021/9/7 11:41 上午
 */

public class ListTest {
    public static void main(String[] args) {
        String[] str = {"a","b","c","d"};
        List<String> list = Arrays.asList(str);
        //不可变列表
        list.forEach(System.out::println);
        //Exception in thread "main" java.lang.UnsupportedOperationException
        list.add("e");
        list.forEach(System.out::println);
    }
}
